<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>Property Management</title>
    <script type="text/javascript">var userType = "<%=session[:user_type]%>"</script>
    <%= stylesheet_link_tag "../javascripts/ext/resources/css/ext-all.css" %>
    <%= stylesheet_link_tag "tasks" %>

    <%= stylesheet_link_tag "images" %>
    <%= stylesheet_link_tag "ext-patch" %>

    <%= javascript_include_tag "ext/adapter/ext/ext-base.js" %>
    <%= javascript_include_tag "ext/ext-all.js" %>
    <%= javascript_include_tag "system/actions.js" %>
    <%= javascript_include_tag "ext/src/locale/ext-lang-zh_CN.js" %>
    <%= csrf_meta_tag %>

  </head>
  <body>
    <script type="text/javascript">
      var authToken = new Ext.form.Hidden({
        name: 'authenticity_token',
        value: '<%=Rack::Utils.escape_html(form_authenticity_token)%>'
      });

      Ext.lib.Ajax.defaultPostHeader += ";charset=UTF-8";
      Ext.data.Connection.prototype.method = 'GET';
      
      function logout(){
        Ext.Ajax.request({
          url : '/fee/logout',
          success : function (result, request) {
            window.document.location.href = '/fee/login';
          },
          failure : function (result, request){
            Ext.MessageBox.alert("提示","通讯失败，请从新操作");
          },
          method : 'GET'
        });
      }
    </script>
    <span></span>
    <ul id="house-actions" class="x-hidden">
      <li>
        <img src="/images/search.png" width=16  height=16/>
        <a id="find_house" href="#">搜索业主</a>
      </li>
      <li>
        <img src="/images/record.png" width=16  height=16/>
        <a id="water_record" href="#">水表抄表记录</a>
      </li>
    </ul>
    <ul id="system-setup" class="x-hidden">
      <li>
        <img src="/images/user.png" width=16  height=16/>
        <a id="user_list" href="#">用户维护</a>
      </li>
      <li>
        <img src="/images/house.png" width=16  height=16/>
        <a id="building_list" href="#">楼座维护</a>
      </li>
      <li>
        <img src="/images/price.png"/>
        <a id="price_list" href="#">价格维护</a>
      </li>
      <li>
        <img src="/images/owner.png"/>
        <a id="house_list" href="#">业主维护</a>
      </li>
    </ul>
    <ul id="system-service" class="x-hidden">
      <li>
        <img src="/images/star.png" width=16  height=16/>
        <a id="group-date" href="#">帮助</a>
      </li>
      <li>
        <img src="/images/stop.png" width=16  height=16/>
        <a id="group-cat" href="#" onclick="logout()">退出系统</a>
      </li>
    </ul>

  </body>
  <%= javascript_include_tag "/javascripts/application.js" %>
</html>
